package com.spzx.user.controller;

import com.spzx.common.core.web.controller.BaseController;
import com.spzx.common.core.web.domain.AjaxResult;
import com.spzx.user.service.RegionService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Haoran Sun
 * @since 2024/07/30
 */

@RestController
@RequestMapping("/region")
public class RegionController extends BaseController {

    @Resource
    private RegionService regionService;

    @GetMapping("/treeSelect/{parentCode}")
    public AjaxResult treeSelect(@PathVariable("parentCode") String parentCode) {

        return success(regionService.treeSelect(parentCode));
    }

}
